export default class score_value extends Laya.Script {
 /** @prop {name:score, tips:"分数", type:Int, default:0}*/
    constructor() { 
        super(); 
     this.score = 0;
        // 更多参数说明请访问: https://ldc2.layabox.com/doc/?nav=zh-as-2-4-0
    }
    
    onEnable() {
    }

    onDisable() {
    }

    onStart(){
        this.score = 0;
    }

    init(mgr){
        this.game_mgr = mgr;
    }

    addScore(flag){
        if(flag){
            this.score -= 100;
        }
        else{
            this.score += 100;
        }
        this.owner.text = this.score.toString();
        if(this.score%2000==0){
            this.game_mgr.speed /= 1.1;
        }
    }
}